package main

func distributeCandies2(candyType []int) int {
	m := make(map[int]int)

	canEatNum := len(candyType) / 2

	for i := 0; i < len(candyType); i++ {
		m[candyType[i]] = 1
	}

	if canEatNum < len(m) {
		return len(m)
	}

	return canEatNum
}
